﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

namespace MessagePack.Formatters
{
	// Token: 0x0200001C RID: 28
	internal class Lookup<TKey, TElement> : ILookup<TKey,TElement>, IEnumerable, IEnumerable<IGrouping<TKey,TElement>>
	{
		// Token: 0x06000063 RID: 99 RVA: 0x00002E1C File Offset: 0x0000121C
		public Lookup(Dictionary<TKey, IGrouping<TKey, TElement>> groupings)
		{
			this.groupings = groupings;
		}

		// Token: 0x17000007 RID: 7
		public IEnumerable<TElement> this[TKey key]
		{
			get
			{
				return this.groupings[key];
			}
		}

		// Token: 0x17000008 RID: 8
		// (get) Token: 0x06000065 RID: 101 RVA: 0x00002E39 File Offset: 0x00001239
		public int Count
		{
			get
			{
				return this.groupings.Count;
			}
		}

		// Token: 0x06000066 RID: 102 RVA: 0x00002E46 File Offset: 0x00001246
		public bool Contains(TKey key)
		{
			return this.groupings.ContainsKey(key);
		}

		// Token: 0x06000067 RID: 103 RVA: 0x00002E54 File Offset: 0x00001254
		public IEnumerator<IGrouping<TKey, TElement>> GetEnumerator()
		{
			return this.groupings.Values.GetEnumerator();
		}

		// Token: 0x06000068 RID: 104 RVA: 0x00002E6B File Offset: 0x0000126B
		IEnumerator IEnumerable.GetEnumerator()
		{
			return this.groupings.Values.GetEnumerator();
		}

		// Token: 0x04000017 RID: 23
		private readonly Dictionary<TKey, IGrouping<TKey, TElement>> groupings;
	}
}
